
package com.xbongbong.saas.domain.dao;

import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.saas.domain.entity.CustomerFocusEntity;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 重点客户DAO
 *
 * @author GuoJun.HU
 * @since V1.0
 * @date 2019/2/19 10:41
 */
public interface CustomerFocusDao {

    Integer insert(CustomerFocusEntity customerFocus);

    Integer update(CustomerFocusEntity customerFocus);

    Integer deleteByKey(@Param("key") Integer key, @Param("corpid") String corpid);

    CustomerFocusEntity getByKey(@Param("key") Long key, @Param("corpid") String corpid);

    List<CustomerFocusEntity> findEntitys(@Param("param") Map<String, Object> param);

    Integer getEntitysCount(@Param("param") Map<String, Object> param);

    CustomerFocusEntity getByCustomerId(@Param("customerId") Long dataId, @Param("userId") String userId, @Param("corpid") String corpid);

    List<Long> getNoShareCustomerIdList(@Param("userId") String userId, @Param("corpid") String corpid);

    List<Long> getShareCustomerIdList(@Param("corpid") String corpid);

    void unFocusBatch(@Param("customerIdIn") List<Long> dataIdList, @Param("corpid") String corpid);

    void unFocus(@Param("customerId") Long customerId, @Param("corpid") String corpid, @Param("userId") String userId);
    /**
     * 取消关注
     * @author 吴峰
     * @date 2019/3/14 16:19
     * @param idIn id列表
     * @param corpid 公司id
     * @return java.lang.Integer
     */
    Integer deleteBatch(@Param("list") List<Long> list, @Param("corpid") String corpid);

    void unFocusByUserIdIn(@Param("customerId")Long customerId, @Param("corpid")String corpid, @Param("userIdIn")List<String> userIdIn);

    void batchUnFocus(@Param("customerIdIn") List<Long> customerIdIn, @Param("corpid")String corpid, @Param("userIdIn")List<String> userIdIn);
}